Attention Deficit Hyperactivity Disorder (ADHD), known for low attention span and hyperactivity, has been a centre of attention in research and public discourse for a long time (Toplak et al., 2006). The prevalence of people diagnosed with ADHD increases yearly and, notably, there was a significant global increase in ADHD symptoms following the COVID-19 pandemic (Rogers et al., 2023). It is thought that the pandemic lockdowns, which forced people to study and work from home, had negatively affected their attention span.
It this report, I will analyse trends in ADHD medication prescriptions in Scotland by comparing data from the pre-COVID-19 period and post-COVID-19 period. The focus is on the number of prescribed doses, which will allow us to see changes over this period. The aim of this report is to answer the question: Has there been an increase in ADHD medication prescription that could reflect an increase in attention-related challenges following pandemic lockdowns?
The overall aim is to uncover trends in ADHD medication prescription in Scotland pre- and post-COVID-19 lockdowns. The report will show:
There are 5 ADHD medications that have been licensed for the treatment of ADHD in the UK by NHS. These medications are:
# if the file "prescriptions.csv" does not exist in the data folder, create it and save it into the data folder
if (!file.exists(file = here("data", "prescriptions.csv"))) {
json <- fromJSON(file = "https://www.opendata.nhs.scot/api/3/action/package_show?id=prescriptions-in-the-community")
# get all the URLs of the dataframes from the json file
urls <- data.frame(url = unlist(map(json$result$resources, function(resource){resource$url}))) %>%
# filter for dataframes that are set between January 2019 and August 2024
mutate(date = as.numeric(str_extract(url, "/pitc(\\d+)\\.csv$", group = 1))) %>%
filter(date > 201812 & date < 202409)
# read the dataframes from URLs and filter for the 5 types of medications licensed for the treatment of ADHD by the NHS
prescriptions <- lapply(urls$url, function(url){
read_csv(url) %>%
clean_names() %>%
filter(str_detect(bnf_item_description, "ATOMOXETINE|DEXAMFETAMINE|GUANFACINE|LISDEXAMFETAMINE|METHYLPHENIDATE")) %>%
# change the name of the "hbt2014" column into "hbt" in dataframes from the year 2019
rename(any_of(c("hbt" = "hbt2014"))) %>%
select(hbt, gp_practice, bnf_item_description, number_of_paid_items, paid_quantity, paid_date_month)
})
# join all dataframes into one dataframe
prescriptions <- prescriptions %>%
reduce(full_join)
# save the dataframe into the data file
write_csv(prescriptions, file = here("data", "prescriptions.csv"))
} else {
prescriptions <- read.csv(here("data", "prescriptions.csv"))
}# get a sum of prescribed doses of the 5 types of ADHD medications per month
overview <- prescriptions %>%
mutate(bnf_item_description = word(bnf_item_description, sep = "[ _]"), # keep only first word of the whole medication name
paid_date_month = ym(paid_date_month)) %>%
group_by(bnf_item_description, paid_date_month) %>%
summarise(paid_quantity = sum(paid_quantity)) %>%
ungroup()
# a graph of the number of prescribed doses of ADHD medication from Jan 2019 to Aug 2024
overview_normal <- overview %>%
plot_ly(x = ~paid_date_month,
y = ~paid_quantity,
type = "scatter",
mode = "lines",
split = ~bnf_item_description,
color = ~bnf_item_description,
legendgroup = ~bnf_item_description,
showlegend = F) %>%
layout(xaxis = list(title = "Date (month and year)"),
yaxis = list(title = "Number of prescribed medications"))
# the same graph but on a log scale
overview_log <- overview %>%
plot_ly(x = ~paid_date_month,
y = ~paid_quantity,
type = "scatter",
mode = "lines",
split = ~bnf_item_description,
color = ~bnf_item_description,
legendgroup = ~bnf_item_description) %>%
layout(xaxis = list(title = "Date (month and year)"),
yaxis = list(title = "Log of number of prescribed medications", type = "log"))
# join the two graphs and tinker with some label title and legend settings
subplot(overview_normal, overview_log, shareX = TRUE, titleX = TRUE, titleY = TRUE, margin = 0.05) %>%
layout(title = "Number of Prescribed Doses of 5 Types of ADHD Medications<br>from January 2019 to August 2024",
hovermode = "x unified",
legend = list(orientation = 'h', y = -0.2, borderwidth = 1, bordercolor = "black", xanchor = "center", x = 0.5))The data indicate that Methylphenidate has shown the highest increase in prescriptions over the years. Although Atomoxetine, Dexamfetamine, and Guanfacine have also seen a steady rise, their growth is not as pronounced as that of Methylphenidate. Notably, in May 2023, prescriptions for Atomoxetine and Dexamfetamine declined, coinciding with the introduction of Lisdexamfetamine to the market. This suggests that Lisdexamfetamine replaced Atomoxetine and Dexamfetamine on the market.
To further investigate the increase in ADHD medications in Scotland, I want to look at differences in individual Scottish Health Boards.
To compare the number of prescribed doses of ADHD medication before and after COVID-19, I will account for population differences across Scottish health boards. For the pre-COVID comparison, I used 2019 population data to reflect the population just before the first lockdown. For the post-COVID period, I selected 2023 as a reference, as the full data for 2024 is not yet available.
# ref: https://www.opendata.nhs.scot/dataset/7f010430-6ce1-4813-b25c-f7f335bdc4dc/resource/27a72cc8-d6d8-430c-8b4f-3109a9ceadb1/download/hb2019_pop_est_14102024.csv
hb_names <- read_csv("https://www.opendata.nhs.scot/dataset/9f942fdb-e59e-44f5-b534-d6e17229cc7b/resource/652ff726-e676-4a20-abda-435b98dd7bdc/download/hb14_hb19.csv")
hb_population <- read_csv(here("data", "hb_population.csv"))
population_2019 <- hb_population %>%
filter(Year == "2019")
population_2023 <- hb_population %>%
filter(Year == "2023")# ref: "https://maps.gov.scot/ATOM/shapefiles/SG_NHS_HealthBoards_2019.zip"
NHS_healthboards <- st_read(here("data", "NHS_healthboards_2019.shp"))## Reading layer `NHS_healthboards_2019' from data source
## `/Users/marianka/Library/CloudStorage/OneDrive-UniversityofEdinburgh/Year 4/Data Science for Biomedical Science/B196940/data/NHS_healthboards_2019.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 14 features and 4 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 7564.996 ymin: 530635.8 xmax: 468754.8 ymax: 1218625
## Projected CRS: OSGB36 / British National Grid
year_2019 <- prescriptions %>%
filter(str_detect(paid_date_month, "2019")) %>%
group_by(hbt) %>%
summarise(paid_quantity = sum(paid_quantity)) %>%
full_join(population_2019, by = c("hbt" = "HB")) %>%
filter(Sex == "All") %>%
select(c(hbt, paid_quantity, AllAges)) %>%
filter(!is.na(paid_quantity)) %>%
mutate(ratio = paid_quantity / AllAges,
year = "2019") %>%
full_join(NHS_healthboards, by = c("hbt" = "HBCode"))
year_2023 <- prescriptions %>%
filter(str_detect(paid_date_month, "2023")) %>%
group_by(hbt) %>%
summarise(paid_quantity = sum(paid_quantity)) %>%
full_join(population_2023, by = c("hbt" = "HB")) %>%
filter(Sex == "All") %>%
select(c(hbt, paid_quantity, AllAges)) %>%
filter(!is.na(paid_quantity)) %>%
mutate(ratio = paid_quantity / AllAges,
year = "2023") %>%
full_join(NHS_healthboards, by = c("hbt" = "HBCode"))map_data <- full_join(year_2019, year_2023)
map_figure <- map_data %>%
ggplot() +
geom_sf(aes(fill = ratio, geometry = geometry, text = paste(HBName, "had a ratio of", format(ratio, digits = 2), "in", year)), lwd = 0.1) +
scale_fill_distiller(palette = 16, direction = 1) +
theme_void() +
theme(plot.title = element_text(size=11)) +
facet_wrap(~year) +
labs(title = "Ratio of Number of Prescribed Doses of ADHD Medication and Health Board Population")
map_figure %>%
ggplotly(tooltip = "text") %>%
style(hoverlabel = list(bgcolor = "white"), hoveron = "fill")Seems like the ratio of population to number of doses of medication is higher in most health boards in Scotland. The only health board that decreased in their number of prescribed doses of ADHD medication is Tayside which went down from 1.02 to 0.904. Grampian has a ratio of 1.33, which is the highest ratio of number of prescribed doses of ADHD medication per person.
To provide a comprehensive overview, I plan to include a table displaying the annual number of prescribed doses for each of the five ADHD medications, alongside the population of Scotland and the ratio of doses per person. This table will be placed between Figure 1 and Figure 2.
Figure 1 illustrates an increase in ADHD medication prescriptions over time, but it does not account for potential population growth. By incorporating the table, I aim to clarify whether the observed rise in prescriptions is proportionate to, or exceeds, population growth. This additional data will help contextualize the trends and provide a more accurate understanding of the changes in prescription rates.
Afterwards, I would give more insight into Figure 2 and explore more of the data it provides about the different Scottish Health Boards.
population_2023 <- population_2023 %>%
clean_names() %>%
filter(sex == "All") %>%
select(hb, all_ages)
past_year_prescriptions <- prescriptions %>%
filter(paid_date_month > 202308 & paid_date_month < 202409) %>%
full_join(population_2023, by = c("hbt" = "hb")) %>%
full_join(hb_names, by = c("hbt" = "HB")) %>%
filter(HBName == "NHS Lothian") %>%
group_by(bnf_item_description, all_ages) %>%
summarise(paid_quantity = sum(paid_quantity),
number_of_paid_items = sum(number_of_paid_items)) %>%
mutate(paid_quantity = (paid_quantity / all_ages) * 10000,
number_of_paid_items = (number_of_paid_items / all_ages) * 10000,
medication_name = word(bnf_item_description, sep = "[ ]"),
dose = word(bnf_item_description, start = 2, end = -1)) %>%
select(!all_ages) %>%
ungroup()
past_year_prescriptions %>%
select(medication_name, dose, number_of_paid_items, paid_quantity) %>%
group_by(medication_name) %>%
slice_max(paid_quantity, n = 3) %>%
arrange(desc(paid_quantity)) %>%
gt() %>%
tab_header(title = "Top 3 Most Prescribed ADHD Medications of Each Type in The Past Year",
subtitle = "Data from NHS Lothian") %>%
tab_style(style = cell_text(weight = "bold"),
locations = list(cells_title(groups = "title"), cells_row_groups(groups = everything()))) %>%
tab_spanner(label = "Rate per 10k population",
columns = c(number_of_paid_items, paid_quantity)) %>%
tab_style(style = cell_text(style = "italic"),
locations = cells_column_spanners(spanners = everything())) %>%
cols_label(medication_name = "Medication Name",
dose = "Dose",
number_of_paid_items = "Number of Paid Items",
paid_quantity = "Number of Prescriptions") %>%
fmt_number(columns = c(number_of_paid_items, paid_quantity), decimals = 2) %>%
summary_rows(columns = c(number_of_paid_items, paid_quantity),
fns = list("Average" = ~mean(., na.rm = TRUE)),
fmt = list(~ fmt_number(., decimals = 2))) %>%
grand_summary_rows(columns = c(number_of_paid_items, paid_quantity),
fns = list("Overall Average" = ~mean(., na.rm = TRUE)),
fmt = list(~ fmt_number(., decimals = 2))) %>%
opt_row_striping()| Top 3 Most Prescribed ADHD Medications of Each Type in The Past Year | |||
| Data from NHS Lothian | |||
| Dose |
Rate per 10k population
|
||
|---|---|---|---|
| Number of Paid Items | Number of Prescriptions | ||
| METHYLPHENIDATE | |||
| 10MG TABLETS | 50.06 | 3,466.82 | |
| 5MG TABLETS | 37.28 | 2,327.26 | |
| 20MG TABLETS | 15.41 | 1,099.76 | |
| Average | — | 34.25 | 2,297.95 |
| DEXAMFETAMINE | |||
| 5MG TABLETS | 15.19 | 1,560.51 | |
| 5MG/5ML ORAL SOLUTION SUGAR FREE | 0.22 | 34.27 | |
| 5MG/5ML ORAL LIQUID | 0.02 | 4.90 | |
| Average | — | 5.14 | 533.23 |
| ATOMOXETINE | |||
| 40MG CAPSULES | 7.62 | 287.83 | |
| 60MG CAPSULES | 5.16 | 205.38 | |
| 10MG CAPSULES | 3.45 | 191.70 | |
| Average | — | 5.41 | 228.30 |
| LISDEXAMFETAMINE | |||
| 30MG CAPSULES | 0.05 | 2.13 | |
| 40MG CAPSULES | 0.05 | 1.52 | |
| 50MG CAPSULES | 0.02 | 0.61 | |
| Average | — | 0.04 | 1.42 |
| GUANFACINE | |||
| 1MG MODIFIED-RELEASE TABLETS | 0.01 | 0.61 | |
| 3MG MODIFIED-RELEASE TABLETS | 0.01 | 0.61 | |
| Average | — | 0.01 | 0.61 |
| Overall Average | — | 9.61 | 655.99 |
Here will be a conclusion soon.
Rogers, M.A. and MacLean, J. (2023) ‘ADHD symptoms increased during the COVID-19 pandemic: A meta-analysis’, Journal of Attention Disorders, 27(8), pp. 800–811. doi:10.1177/10870547231158750.
Toplak, M.E., Dockstader, C., Tannock, R. (2006) ‘Temporal information processing in ADHD: Findings to date and New Methods’, Journal of Neuroscience Methods, 151(1), pp. 15–29. doi:10.1016/j.jneumeth.2005.09.018.